-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decouple isTesting Platform flag from disabling/enabling animations when testing #38490
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
facebook-github-bot
added
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
p: Facebook
Partner: Facebook
Partner
fb-exported
labels
Jul 18, 2023
This pull request was exported from Phabricator. Differential Revision: D47516800 |
…hen testing (facebook#38490) Summary: Pull Request resolved: facebook#38490 ## Changelog [Internal] - The internal `Platform.isTesting` is tightly coupled to animations being disabled, which in turn can lead to subtle problems in some of the corner cases: * Since `isTesting` is force override to `false` on JS side in non-dev builds, it means that e2e tests, that would like to use release builds, are out of luck when animation disabling is desired * Conversely, some of the e2e tests may actually rely on animations being enabled in order to work, which means they are also out of luck if trying to test a dev build * Finally, we have cases of hybrid builds, which are build in release on native side, but also have `__DEV__=true` on the native side To both cover the above scenarios, but also to be backwards compatible to all the existing once, this change introduces another flag, `Platform.isDisableAnimations`. The way it works is: * If it's not specified, the e2e tests behaviour will be exactly the same as before, since by default `isDisableAnimations` will be true when `isTesting` is true * If it's specified and is equal to `false`, it means that animations will be still enabled, even if `isTesting` is true (for those e2e tests that rely on animations being enabled) * If it's specified and is equal to 'true', it means that animations will be force disabled, no matter whether we test a release or a dev build Note that this only specifies the JS side of things, defaulting `Platform.isDisableAnimations` to "not specified" (i.e. all the tests will behave as before). Pulling it through for different platforms is done as a separate follow-up. Differential Revision: D47516800 fbshipit-source-id: ba338e931ff51d4420feda6c32e7400656beb842
This pull request was exported from Phabricator. Differential Revision: D47516800 |
Base commit: 777934e |
This pull request was successfully merged by @rshest in 04ad34d. When will my fix make it into a release? | Upcoming Releases |
rshest
added a commit
to rshest/react-native
that referenced
this pull request
Jul 19, 2023
Summary: ## Changelog [Internal] - This allows to override `Platform.isDisableAnimations` for the Android platform, in the same way as it's done with `IS_TESTING` (but similarly optionally doing `IS_DISABLE_ANIMATIONS` in addition to/instead). See for more context: facebook#38490 Differential Revision: D47530731 fbshipit-source-id: 80c63787bca303cbedddb05a64eee99d98a51ff6
rshest
added a commit
to rshest/react-native
that referenced
this pull request
Jul 19, 2023
…facebook#38511) Summary: Pull Request resolved: facebook#38511 ## Changelog [Internal] - This allows to override `Platform.isDisableAnimations` for the Android platform, in the same way as it's done with `IS_TESTING` (but similarly optionally doing `IS_DISABLE_ANIMATIONS` in addition to/instead). See for more context: facebook#38490 Reviewed By: cortinico Differential Revision: D47530731 fbshipit-source-id: 1f08f1ec0ec64c880975dfef27a202fba6d26bd7
facebook-github-bot
pushed a commit
that referenced
this pull request
Jul 19, 2023
…#38511) Summary: Pull Request resolved: #38511 ## Changelog [Internal] - This allows to override `Platform.isDisableAnimations` for the Android platform, in the same way as it's done with `IS_TESTING` (but similarly optionally doing `IS_DISABLE_ANIMATIONS` in addition to/instead). See for more context: #38490 Reviewed By: cortinico Differential Revision: D47530731 fbshipit-source-id: b90300124b2a8bac97fae78a94e8a2cc9d7fd5bc
juniorklawa
pushed a commit
to juniorklawa/react-native
that referenced
this pull request
Jul 20, 2023
…hen testing (facebook#38490) Summary: Pull Request resolved: facebook#38490 ## Changelog [Internal] - The internal `Platform.isTesting` is tightly coupled to animations being disabled, which in turn can lead to subtle problems in some of the corner cases: * Since `isTesting` is force override to `false` on JS side in non-dev builds, it means that e2e tests, that would like to use release builds, are out of luck when animation disabling is desired * Conversely, some of the e2e tests may actually rely on animations being enabled in order to work, which means they are also out of luck if trying to test a dev build * Finally, we have cases of hybrid builds, which are build in release on native side, but also have `__DEV__=true` on the native side To both cover the above scenarios, but also to be backwards compatible to all the existing once, this change introduces another flag, `Platform.isDisableAnimations`. The way it works is: * If it's not specified, the e2e tests behaviour will be exactly the same as before, since by default `isDisableAnimations` will be true when `isTesting` is true * If it's specified and is equal to `false`, it means that animations will be still enabled, even if `isTesting` is true (for those e2e tests that rely on animations being enabled) * If it's specified and is equal to 'true', it means that animations will be force disabled, no matter whether we test a release or a dev build Note that this only specifies the JS side of things, defaulting `Platform.isDisableAnimations` to "not specified" (i.e. all the tests will behave as before). Pulling it through for different platforms is done as a separate follow-up. Differential Revision: D47516800 fbshipit-source-id: efcb78f68f9102fec025ecce9a475c9c0bc1ecca
juniorklawa
pushed a commit
to juniorklawa/react-native
that referenced
this pull request
Jul 20, 2023
…facebook#38511) Summary: Pull Request resolved: facebook#38511 ## Changelog [Internal] - This allows to override `Platform.isDisableAnimations` for the Android platform, in the same way as it's done with `IS_TESTING` (but similarly optionally doing `IS_DISABLE_ANIMATIONS` in addition to/instead). See for more context: facebook#38490 Reviewed By: cortinico Differential Revision: D47530731 fbshipit-source-id: b90300124b2a8bac97fae78a94e8a2cc9d7fd5bc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
fb-exported
Merged
This PR has been merged.
p: Facebook
Partner: Facebook
Partner
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
Changelog
[Internal] -
The internal
Platform.isTesting
is tightly coupled to animations being disabled, which in turn can lead to subtle problems in some of the corner cases:isTesting
is force override tofalse
on JS side in non-dev builds, it means that e2e tests, that would like to use release builds, are out of luck when animation disabling is desired__DEV__=true
on the native sideTo both cover the above scenarios, but also to be backwards compatible to all the existing once, this change introduces another flag,
Platform.isDisableAnimations
.The way it works is:
isDisableAnimations
will be true whenisTesting
is truefalse
, it means that animations will be still enabled, even ifisTesting
is true (for those e2e tests that rely on animations being enabled)Note that this only specifies the JS side of things, defaulting
Platform.isDisableAnimations
to "not specified" (i.e. all the tests will behave as before).Pulling it through for different platforms is done as a separate follow-up.
Differential Revision: D47516800